<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

    </style>
</head>
<body>
<div id="app">
<my-computer>
    <div slot="cpu"> Inter core 8</div>
    <img slot="voice" src="1.jpg" alt="">
</my-computer>
</div>

<!--模板-->
<template id="my_computer">
    <div id="main">
        <slot name="cpu">这是插CPU的</slot>
        <slot name="gpu">这是插GPU的</slot>
        <slot name="memory">这是插内存条的</slot>
        <slot name="hard-drive">这是插硬盘的</slot>
        <slot name="voice">这是插声卡的</slot>
    </div>
</template>

<script src="js/vue.js"></script>
<script>
    /*regist*/
    Vue.component('my-computer',{
        template:'#my_computer',
    });
    new Vue({
        el:"#app",
//        data:"宇宙无敌小可爱"
    });
    
</script>
</body>
</html>